home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Include / DShowIDL / Mpeg2Structs.idl < prev    next >
Encoding:
Text File  |  2002-11-12  |  8.8 KB  |  369 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation.  All rights reserved.
  4. //
  5. // Module Name:
  6. //
  7. //      Mpeg2Structs.idl
  8. //
  9. // Abstract:
  10. //
  11. //      Definitions for the common structures used in Mpeg2Data
  12. //
  13. // Notes:
  14. //
  15. //      This IDL file is not built independently, but is included and built
  16. //      in the master IDL file Mpeg2Data.idl
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19.  
  20.     // Include Files
  21. #include "Mpeg2Bits.h"
  22.  
  23.  
  24.  
  25. //
  26. // Basic Type Aliases
  27. //
  28.  
  29. typedef WORD PID;
  30. typedef BYTE TID;
  31. typedef UINT ClientKey;
  32.  
  33.  
  34.  
  35. //
  36. // MPEG-2 Current/Next bit field
  37. //
  38.  
  39. typedef enum
  40. {
  41.     MPEG_SECTION_IS_NEXT = 0,
  42.     MPEG_SECTION_IS_CURRENT = 1
  43. } MPEG_CURRENT_NEXT_BIT;
  44.  
  45.  
  46.  
  47. //
  48. // MPEG-2 TID Extension structure
  49. //
  50.  
  51. typedef struct
  52. {
  53.     WORD   wTidExt;
  54.     WORD   wCount;
  55. } TID_EXTENSION, *PTID_EXTENSION;
  56.  
  57.  
  58.  
  59. //
  60. // MPEG-2 packet "small" header structure
  61. //
  62.  
  63. typedef struct
  64. {
  65.     TID     TableId;
  66.     union
  67.     {
  68.         MPEG_HEADER_BITS_MIDL S;
  69.         WORD                  W;
  70.     }       Header;
  71.     BYTE    SectionData[1];     // Array size is Header.S.SectionLength
  72. } SECTION, *PSECTION;
  73.  
  74.  
  75.  
  76. //
  77. // MPEG-2 packet "long" header structure
  78. //
  79.  
  80. typedef struct
  81. {
  82.     TID     TableId;
  83.     union
  84.     {
  85.         MPEG_HEADER_BITS_MIDL S;
  86.         WORD                  W;
  87.     }       Header;
  88.     WORD    TableIdExtension;
  89.     union
  90.     {
  91.         MPEG_HEADER_VERSION_BITS_MIDL S;
  92.         BYTE                          B;
  93.     }       Version;
  94.     BYTE    SectionNumber;
  95.     BYTE    LastSectionNumber;
  96.     BYTE    RemainingData[1];   // Array size is Header.S.SectionLength - 5
  97. } LONG_SECTION, *PLONG_SECTION;
  98.  
  99.  
  100.  
  101. //
  102. // DSM-CC packet header structure
  103. //
  104.  
  105. typedef struct
  106. {
  107.     TID     TableId;
  108.     union
  109.     {
  110.         MPEG_HEADER_BITS_MIDL S;
  111.         WORD                  W;
  112.     }       Header;
  113.     WORD    TableIdExtension;
  114.     union
  115.     {
  116.         MPEG_HEADER_VERSION_BITS_MIDL S;
  117.         BYTE                          B;
  118.     }       Version;
  119.     BYTE    SectionNumber;
  120.     BYTE    LastSectionNumber;
  121.     BYTE    ProtocolDiscriminator;
  122.     BYTE    DsmccType;
  123.     WORD    MessageId;
  124.     DWORD   TransactionId;
  125.     BYTE    Reserved;
  126.     BYTE    AdaptationLength;
  127.     WORD    MessageLength;
  128.     BYTE    RemainingData[1];
  129. } DSMCC_SECTION, *PDSMCC_SECTION;
  130.  
  131.  
  132.  
  133. //
  134. // MPEG-2 request/response packets structures
  135. //
  136.  
  137. typedef struct
  138. {
  139.     DWORD    dwLength;
  140.     PSECTION pSection;
  141. } MPEG_RQST_PACKET, *PMPEG_RQST_PACKET;
  142.  
  143. typedef struct
  144. {
  145.     WORD              wPacketCount;
  146.     PMPEG_RQST_PACKET PacketList[1];    // Array size is wPacketCount;
  147. } MPEG_PACKET_LIST, *PMPEG_PACKET_LIST;
  148.  
  149.  
  150.  
  151. //
  152. // DSM-CC request filter options
  153. //
  154.  
  155. typedef struct
  156. {
  157.     BOOL  fSpecifyProtocol;       // If true, Protocol should be set to desired value
  158.     BYTE  Protocol;
  159.     BOOL  fSpecifyType;           // If true, Type should be set to desired value
  160.     BYTE  Type;
  161.     BOOL  fSpecifyMessageId;      // If true, MessageId should be set to desired value
  162.     WORD  MessageId;
  163.     BOOL  fSpecifyTransactionId;  // If true, TransactionId (or DownloadId for DDB msgs) should be set to desired value
  164.     BOOL  fUseTrxIdMessageIdMask; // If false, TransactionId is filtered as is.
  165.                                   // If true, TransactionId is masked to look
  166.                                   // for any version of message with associated
  167.                                   // message identifier. See DVB - Data
  168.                                   // Broadcasting Guidlines 4.6.5. (Assignment
  169.                                   // and use of transactionId values).
  170.     DWORD TransactionId;
  171.     BOOL  fSpecifyModuleVersion;  // If true, ModuleVersion should be set to the desired value
  172.     BYTE  ModuleVersion;
  173.     BOOL  fSpecifyBlockNumber;    // If true, BlockNumber should be set to desired value
  174.     WORD  BlockNumber;
  175.     BOOL  fGetModuleCall;         // If true, NumberOfBlocksInModule should be set
  176.     WORD  NumberOfBlocksInModule; 
  177. } DSMCC_FILTER_OPTIONS;
  178. // 45 BYTES
  179.  
  180.  
  181.  
  182. //
  183. // ATSC request filter options
  184. //
  185.  
  186. typedef struct
  187. {
  188.     BOOL  fSpecifyEtmId;          // If true, EtmId should be set to desired value
  189.     DWORD EtmId;
  190. } ATSC_FILTER_OPTIONS;
  191. // 8 BYTES
  192.  
  193.  
  194.  
  195. //
  196. // MPEG-2 request filter structure
  197. //
  198.  
  199. typedef struct
  200. {
  201.     BYTE  bVersionNumber;           // Must be set to 1 or more to match filter definition
  202.     WORD  wFilterSize;              // Size of total filter structure. Version 1 filter is 73 bytes.
  203.     BOOL  fUseRawFilteringBits;     // If true, Filter and Mask fields should be set to desired value, all other
  204.                                     // fields with be ignored.
  205.     BYTE  Filter[16];               // Bits with values to compare against for a match.
  206.     BYTE  Mask[16];                 // Bits set to 0 are bits that are compared to those in the filter, those
  207.                                     // bits set to 1 are ignored.
  208.     BOOL  fSpecifyTableIdExtension; // If true, TableIdExtension should be set to desired value (false = don't care)
  209.     WORD  TableIdExtension;
  210.     BOOL  fSpecifyVersion;          // If true, Version should be set to desired value (false = don't care)
  211.     BYTE  Version;
  212.     BOOL  fSpecifySectionNumber;    // If true, SectionNumber should be set to desired value (false = don't care)
  213.     BYTE  SectionNumber;
  214.     BOOL  fSpecifyCurrentNext;      // If true, fNext should be set to desired value (false = don't care)
  215.     BOOL  fNext;                    // If true, next table is queried. Else, current
  216.     BOOL  fSpecifyDsmccOptions;     // If true, Dsmcc should be set with desired filter options
  217.     DSMCC_FILTER_OPTIONS Dsmcc;
  218.     BOOL  fSpecifyAtscOptions;      // If true, Atsc should be set with desired filter options
  219.     ATSC_FILTER_OPTIONS Atsc;
  220. } MPEG2_FILTER, *PMPEG2_FILTER;
  221. // 124 BYTES
  222.  
  223. cpp_quote("#define MPEG2_FILTER_VERSION_1_SIZE  124")
  224.  
  225.  
  226. //
  227. // Mpeg-2 Stream buffer structure
  228. //
  229.  
  230. typedef struct
  231. {
  232.     HRESULT hr;
  233.     DWORD   dwDataBufferSize;
  234.     DWORD   dwSizeOfDataRead;
  235.     BYTE *  pDataBuffer;
  236. } MPEG_STREAM_BUFFER, *PMPEG_STREAM_BUFFER;
  237.  
  238.  
  239.         
  240. //
  241. // MPEG-2 Time and Date structures
  242. //
  243.  
  244. typedef struct
  245. {
  246.     BYTE Hours;     // Legal Range: 0 to 23
  247.     BYTE Minutes;   // Legal Range: 0 to 59
  248.     BYTE Seconds;   // Legal Range: 0 to 59
  249. } MPEG_TIME;
  250.  
  251. typedef MPEG_TIME MPEG_DURATION;
  252.  
  253. typedef struct
  254. {
  255.     BYTE Date;      // Legal Range: 1 to 31
  256.     BYTE Month;     // Legal Range: 1 to 12
  257.     WORD Year;      // Legal Range: 1900 to 2100 
  258. } MPEG_DATE;
  259.  
  260. typedef struct
  261. {
  262.     MPEG_DATE D;
  263.     MPEG_TIME T;
  264. } MPEG_DATE_AND_TIME;
  265.  
  266.  
  267.  
  268. //
  269. // MPEG-2 API Context structures
  270. //
  271.  
  272. typedef enum
  273. {
  274.     MPEG_CONTEXT_BCS_DEMUX,
  275.     MPEG_CONTEXT_WINSOCK
  276. } MPEG_CONTEXT_TYPE;
  277.  
  278. typedef struct
  279. {
  280.     DWORD AVMGraphId;
  281. } MPEG_BCS_DEMUX;
  282.  
  283. typedef struct
  284. {
  285.     DWORD AVMGraphId;
  286. } MPEG_WINSOCK;
  287.  
  288. typedef struct
  289. {
  290.     MPEG_CONTEXT_TYPE Type;
  291.     union
  292.     {
  293.         MPEG_BCS_DEMUX      Demux;
  294.         MPEG_WINSOCK        Winsock;
  295.     } U;
  296. } MPEG_CONTEXT, *PMPEG_CONTEXT;
  297.  
  298.  
  299.  
  300. //
  301. // MPEG-2 Service Request and Responses
  302. //
  303.  
  304. typedef enum
  305. {
  306.     MPEG_RQST_UNKNOWN = 0, 
  307.     MPEG_RQST_GET_SECTION,
  308.     MPEG_RQST_GET_SECTION_ASYNC,
  309.     MPEG_RQST_GET_TABLE,
  310.     MPEG_RQST_GET_TABLE_ASYNC,
  311.     MPEG_RQST_GET_SECTIONS_STREAM,
  312.     MPEG_RQST_GET_PES_STREAM,
  313.     MPEG_RQST_GET_TS_STREAM,
  314.     MPEG_RQST_START_MPE_STREAM,
  315. } MPEG_REQUEST_TYPE;
  316.  
  317. typedef struct
  318. {
  319.     MPEG_REQUEST_TYPE       Type;
  320.     MPEG_CONTEXT            Context;
  321.     PID                     Pid;
  322.     TID                     TableId;
  323.     MPEG2_FILTER            Filter;
  324.     DWORD                   Flags;
  325. } MPEG_SERVICE_REQUEST, *PMPEG_SERVICE_REQUEST;
  326.  
  327. typedef struct
  328. {
  329.     DWORD                   IPAddress;
  330.     WORD                    Port;
  331. } MPEG_SERVICE_RESPONSE, *PMPEG_SERVICE_RESPONSE;
  332.  
  333.  
  334.  
  335. //
  336. // DSM-CC & MPE Query Results
  337. //
  338.  
  339. typedef struct _DSMCC_ELEMENT
  340. {
  341.     PID                     pid;
  342.     BYTE                    bComponentTag;
  343.     DWORD                   dwCarouselId;
  344.     DWORD                   dwTransactionId;
  345.     struct _DSMCC_ELEMENT * pNext;
  346. } DSMCC_ELEMENT, *PDSMCC_ELEMENT;
  347.  
  348. typedef struct _MPE_ELEMENT
  349. {
  350.     PID                     pid;
  351.     BYTE                    bComponentTag;
  352.     struct _MPE_ELEMENT *   pNext;
  353. } MPE_ELEMENT, *PMPE_ELEMENT;
  354.  
  355.  
  356.  
  357. //
  358. // MPEG-2 Stream Filtering Structure
  359. //
  360.  
  361. typedef struct _MPEG_STREAM_FILTER 
  362. {
  363.     WORD   wPidValue;               // PID value
  364.     DWORD  dwFilterSize;            // size of filter in bits
  365.     BOOL   fCrcEnabled;             // enable/disable CRC check 
  366.     BYTE   rgchFilter[16];          // filter data
  367.     BYTE   rgchMask[16];            // filter mask
  368. } MPEG_STREAM_FILTER;
  369.